home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / kcl / akcl / akcl1615.lha / c / rel_stand.c < prev    next >
C/C++ Source or Header  |  1988-09-18  |  1KB  |  70 lines

  1.  
  2. #ifdef STAND
  3.  
  4.  
  5. #define object char *
  6. #define close_stream(a,b) 
  7. #define coerce_to_filename(a,b)
  8. #define FEerror(a,b,c) printf(a)
  9. #define vs_push(a)
  10. #define read_fasl_vector(a) 0;
  11.  
  12. int test;
  13. char *joey="hi bill";
  14.  
  15. char *kcl_self,*system_directory;
  16.  
  17. main(argc,argv)
  18. int argc;
  19. char *argv[];     
  20. {argc;
  21.  kcl_self=argv[2];
  22.  system_directory=argv[3];
  23.  fasload(argv[1]);
  24. }
  25.  
  26. node_compare(node1,node2)
  27. char *node1, *node2;
  28. { return(strcmp( ((struct node *)node1)->string,
  29.              ((struct node *)node2)->string));}
  30.  
  31.  
  32.  
  33. read_special_symbols(symfile)
  34. char *symfile;
  35. {FILE *symin;
  36.  char *symbols;
  37.  int i,jj;
  38.  struct lsymbol_table tab;
  39.  if (!(symin=fopen(symfile,"r")))
  40.    {perror(symfile);exit(1);};
  41.  if(!fread((char *)&tab,sizeof(tab),1,symin))
  42.    FEerror("No header",0,0);
  43.  symbols=malloc(tab.tot_leng);
  44.  c_table.alloc_length=( (PTABLE_EXTRA+ tab.n_symbols));
  45.  (c_table.ptable) = (TABL *) malloc(sizeof(struct node) * c_table.alloc_length);
  46.  if (!(c_table.ptable)) {perror("could not allocate"); exit(1);};
  47.  i=0; c_table.length=tab.n_symbols;
  48.  while(i < tab.n_symbols)
  49.    { fread((char *)&jj,sizeof(int),1,symin);
  50.      (SYM_ADDRESS(c_table,i))=jj;
  51.      SYM_STRING(c_table,i)=symbols;
  52.  
  53.      while( *(symbols++) =   getc(symin)) 
  54.        {;}
  55. /*     dprintf( name %s ,  SYM_STRING(c_table,i));
  56.      dprintf( addr %d , jj);
  57. */
  58.      i++;
  59.    }
  60.  
  61.  /*
  62.    for(i=0;i< 5;i++)
  63.    {printf("Symbol: %d %s %d \n",i,SYM_STRINGN(c_table,i),
  64.    SYM_ADDRESS(*ptable,i));}
  65.    */
  66. }
  67.  
  68. #endif  /* STAND */
  69.  
  70.